package com.example.controller;


import com.example.service.LoginService;
import com.example.pojo.User;
import com.example.util.ResponseWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/main")
    public ResponseWrapper<User> login(@RequestBody Map<String, String> userData){
        User user = loginService.login(userData.get("loginName"),userData.get("loginPassword"));
        System.out.println("用户信息"+user);
        return ResponseWrapper.success(user);
    }


}
